import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
//引入测试数据
import { loginUsers, listCourse, noticeList } from './data/user'
import { getAllListScore, insertSelective , selectIdName , updateByPrimaryKey} from './data/score'
let _listCourse = listCourse
let _loginUsers = loginUsers

export default {




	mockTest() {
		let mock = new MockAdapter(axios);
		
		mock.onPost('/api/teacher/login').reply(200,{
  message: "登陆成功！",
  resData: {
    "teacherId": 0,
    "courseId": 1,
    "roleId": 1,
    "teacherPassword": "4ca46ef3ea5aa7b94c551be0657f6fe3",
    "teacherRealname": "张三",
    "teacherBirth": 1500393600000,
    "teacherSex": "男",
    "teacherPolitical": "dangyuan",
    "teacherNational": "汉",
    "teacherRecord": "博士",
    "teacherNative": "河南",
    "teacherSchool": "郑州大学",
    "teacherDegree": "学士",
    "teacherEmail": "120@qq.com",
    "teacherPhone": "1231321231321",
    "teacherAddress": "郑州",
    "teacherCategory": "教授",
    "teacherPhoto": "暂无",
    "teacherCreateDate": 1500393600000,
    "teacherLastLogindate": 1500393600000,
    "teacherLoginSumtime": 2131654,
    "teacherModifyPerson": "0",
    "teacherModifyDate": 1500393600000,
    "teacherDelete": 1
  },
  status: 200
});
		
		
		
		
		 mock.onPost('/api/teacher/courseware/store/get').reply(200,{status:200, message:'',
      resData:
      [
  {
    "storeId": 1,
    "storeName": "java课程",
    "storeExplain": "针对java",
    "storeDelete": 1,
    "judges": [
      {
        "judgeId": 1,
        "storeId": 1,
        "teacherId": 1,
        "judgeName": "张春雷",
        "judgeOne": "是的",
        "judgeTwo": "不是",
        "judgeAnswer": "A",
        "judgePoint": 2,
        "judgeAddtime": 1499270400000,
        "judgeAdduser": "zr",
        "judgeModifyDate": 1500220800000,
        "judgeModifyPerson": "李志鹏",
        "judgeDelete": 0,
        "scoreType": 1,
        "courseId": 1,
        "sectionTestId": null,
        "enterTestType": null,
        "judgeType": 0,
        "store": null
      }
    ],
    "selects": [
      {
        "selectId": 1,
        "teacherId": 1,
        "storeId": 1,
        "selectName": "张春雷",
        "selectA": "是",
        "selectB": "否",
        "selectC": "好",
        "selectD": "不好",
        "selectAnswer": "D",
        "selectPoint": 2,
        "selectAddtime": 1499270400000,
        "selectModifyDate": 1500307200000,
        "selectModifyPerson": "李志鹏",
        "selectDelete": 0,
        "scoreType": 1,
        "courseId": 1,
        "sectionTestId": null,
        "enterTestType": null,
        "selectType": 1,
        "store": null
      },
      {
        "selectId": 3,
        "teacherId": 1,
        "storeId": 1,
        "selectName": "asd",
        "selectA": "1",
        "selectB": "2",
        "selectC": "3",
        "selectD": "4",
        "selectAnswer": "D",
        "selectPoint": 2,
        "selectAddtime": 1499270400000,
        "selectModifyDate": 1500307200000,
        "selectModifyPerson": "李志鹏",
        "selectDelete": 0,
        "scoreType": 1,
        "courseId": 1,
        "sectionTestId": null,
        "enterTestType": null,
        "selectType": 1,
        "store": null
      },
      {
        "selectId": 4,
        "teacherId": 1,
        "storeId": 1,
        "selectName": "int有几个字节",
        "selectA": "1",
        "selectB": "2",
        "selectC": "3",
        "selectD": "4",
        "selectAnswer": "D",
        "selectPoint": 2,
        "selectAddtime": 1499270400000,
        "selectModifyDate": 1499270400000,
        "selectModifyPerson": "zr",
        "selectDelete": 1,
        "scoreType": 1,
        "courseId": 1,
        "sectionTestId": null,
        "enterTestType": null,
        "selectType": 1,
        "store": null
      },
      {
        "selectId": 5,
        "teacherId": 1,
        "storeId": 1,
        "selectName": "int有几个字节",
        "selectA": "1",
        "selectB": "2",
        "selectC": "3",
        "selectD": "4",
        "selectAnswer": "D",
        "selectPoint": 2,
        "selectAddtime": 1499270400000,
        "selectModifyDate": 1499270400000,
        "selectModifyPerson": "zr",
        "selectDelete": 1,
        "scoreType": 1,
        "courseId": 1,
        "sectionTestId": null,
        "enterTestType": null,
        "selectType": 1,
        "store": null
      },
      {
        "selectId": 6,
        "teacherId": 1,
        "storeId": 1,
        "selectName": "int有几个字节",
        "selectA": "1",
        "selectB": "2",
        "selectC": "3",
        "selectD": "4",
        "selectAnswer": "D",
        "selectPoint": 2,
        "selectAddtime": 1499270400000,
        "selectModifyDate": 1499270400000,
        "selectModifyPerson": "zr",
        "selectDelete": 1,
        "scoreType": 1,
        "courseId": 1,
        "sectionTestId": null,
        "enterTestType": null,
        "selectType": 1,
        "store": null
      }
    ]
  }
]


    });
		  mock.onPost('/api/teacher/courseInform/getlist').reply(200,{status:200, message:'',
      resData:
  
 {
    "pageNum": 1,
    "pageSize": 5,
    "size": 5,
    "startRow": 1,
    "endRow": 5,
    "total": 40,
    "pages": 8,
    "list": [
      {
        "informId": null,
        "teacherId": null,
        "courseId": null,
        "informDate": 1500480000000,
        "informInformtitle": "777",
        "course": {
          "courseId": null,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "环艺",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": {
            "teacherId": null,
            "courseId": null,
            "roleId": null,
            "teacherPassword": null,
            "teacherRealname": "张三",
            "teacherBirth": null,
            "teacherSex": null,
            "teacherPolitical": null,
            "teacherNational": null,
            "teacherRecord": null,
            "teacherNative": null,
            "teacherSchool": null,
            "teacherDegree": null,
            "teacherEmail": null,
            "teacherPhone": null,
            "teacherAddress": null,
            "teacherCategory": null,
            "teacherPhoto": null,
            "teacherCreateDate": null,
            "teacherLastLogindate": null,
            "teacherLoginSumtime": null,
            "teacherModifyPerson": null,
            "teacherModifyDate": null,
            "teacherDelete": null
          }
        },
        "informDelete": null
      },
      {
        "informId": null,
        "teacherId": null,
        "courseId": null,
        "informDate": 1499616000000,
        "informInformtitle": "java明天不上课，在家休息",
        "course": {
          "courseId": null,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": {
            "teacherId": null,
            "courseId": null,
            "roleId": null,
            "teacherPassword": null,
            "teacherRealname": "张三",
            "teacherBirth": null,
            "teacherSex": null,
            "teacherPolitical": null,
            "teacherNational": null,
            "teacherRecord": null,
            "teacherNative": null,
            "teacherSchool": null,
            "teacherDegree": null,
            "teacherEmail": null,
            "teacherPhone": null,
            "teacherAddress": null,
            "teacherCategory": null,
            "teacherPhoto": null,
            "teacherCreateDate": null,
            "teacherLastLogindate": null,
            "teacherLoginSumtime": null,
            "teacherModifyPerson": null,
            "teacherModifyDate": null,
            "teacherDelete": null
          }
        },
        "informDelete": null
      },
      {
        "informId": null,
        "teacherId": null,
        "courseId": null,
        "informDate": 1499616000000,
        "informInformtitle": "Java明天不上课",
        "course": {
          "courseId": null,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": {
            "teacherId": null,
            "courseId": null,
            "roleId": null,
            "teacherPassword": null,
            "teacherRealname": "张三",
            "teacherBirth": null,
            "teacherSex": null,
            "teacherPolitical": null,
            "teacherNational": null,
            "teacherRecord": null,
            "teacherNative": null,
            "teacherSchool": null,
            "teacherDegree": null,
            "teacherEmail": null,
            "teacherPhone": null,
            "teacherAddress": null,
            "teacherCategory": null,
            "teacherPhoto": null,
            "teacherCreateDate": null,
            "teacherLastLogindate": null,
            "teacherLoginSumtime": null,
            "teacherModifyPerson": null,
            "teacherModifyDate": null,
            "teacherDelete": null
          }
        },
        "informDelete": null
      },
      {
        "informId": null,
        "teacherId": null,
        "courseId": null,
        "informDate": 1499616000000,
        "informInformtitle": "下午上课",
        "course": {
          "courseId": null,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "c语言2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": {
            "teacherId": null,
            "courseId": null,
            "roleId": null,
            "teacherPassword": null,
            "teacherRealname": "张三",
            "teacherBirth": null,
            "teacherSex": null,
            "teacherPolitical": null,
            "teacherNational": null,
            "teacherRecord": null,
            "teacherNative": null,
            "teacherSchool": null,
            "teacherDegree": null,
            "teacherEmail": null,
            "teacherPhone": null,
            "teacherAddress": null,
            "teacherCategory": null,
            "teacherPhoto": null,
            "teacherCreateDate": null,
            "teacherLastLogindate": null,
            "teacherLoginSumtime": null,
            "teacherModifyPerson": null,
            "teacherModifyDate": null,
            "teacherDelete": null
          }
        },
        "informDelete": null
      },
      {
        "informId": null,
        "teacherId": null,
        "courseId": null,
        "informDate": 1499616000000,
        "informInformtitle": "上午上课",
        "course": {
          "courseId": null,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "环艺",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": {
            "teacherId": null,
            "courseId": null,
            "roleId": null,
            "teacherPassword": null,
            "teacherRealname": "张三",
            "teacherBirth": null,
            "teacherSex": null,
            "teacherPolitical": null,
            "teacherNational": null,
            "teacherRecord": null,
            "teacherNative": null,
            "teacherSchool": null,
            "teacherDegree": null,
            "teacherEmail": null,
            "teacherPhone": null,
            "teacherAddress": null,
            "teacherCategory": null,
            "teacherPhoto": null,
            "teacherCreateDate": null,
            "teacherLastLogindate": null,
            "teacherLoginSumtime": null,
            "teacherModifyPerson": null,
            "teacherModifyDate": null,
            "teacherDelete": null
          }
        },
        "informDelete": null
      }
    ],
    "prePage": 0,
    "nextPage": 2,
    "isFirstPage": true,
    "isLastPage": false,
    "hasPreviousPage": false,
    "hasNextPage": true,
    "navigatePages": 8,
    "navigatepageNums": [
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8
    ],
    "navigateFirstPage": 1,
    "navigateLastPage": 8,
    "firstPage": 1,
    "lastPage": 8
  }

  }) ;

    mock.onPost('/api/teacher/exam/getlist').reply(200,{status:200, message:'', resData: 
    {
    "pageNum": 1,
    "pageSize": 5,
    "size": 5,
    "startRow": 1,
    "endRow": 5,
    "total": 35,
    "pages": 7,
    "list": [
      {
        "examId": null,
        "courseId": null,
        "teacherId": null,
        "examPlace": "亚武山",
        "examTime": 1499011200000,
        "examAppointTime": 1499011200000,
        "examForm": "网上考试",
        "examAddtime": null,
        "examMotifyPerson": null,
        "examMotifyDate": null,
        "examDelete": null,
        "course": {
          "courseId": 1,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": null
        }
      },
      {
        "examId": null,
        "courseId": null,
        "teacherId": null,
        "examPlace": "华山",
        "examTime": 1499011200000,
        "examAppointTime": 1499011200000,
        "examForm": "网上考试",
        "examAddtime": null,
        "examMotifyPerson": null,
        "examMotifyDate": null,
        "examDelete": null,
        "course": {
          "courseId": 1,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": null
        }
      },
      {
        "examId": null,
        "courseId": null,
        "teacherId": null,
        "examPlace": "黄山",
        "examTime": 1430755200000,
        "examAppointTime": 1499356800000,
        "examForm": "网上考试",
        "examAddtime": null,
        "examMotifyPerson": null,
        "examMotifyDate": null,
        "examDelete": null,
        "course": {
          "courseId": 1,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": null
        }
      },
      {
        "examId": null,
        "courseId": null,
        "teacherId": null,
        "examPlace": "黄山",
        "examTime": 1430755200000,
        "examAppointTime": 1499356800000,
        "examForm": "网上考试",
        "examAddtime": null,
        "examMotifyPerson": null,
        "examMotifyDate": null,
        "examDelete": null,
        "course": {
          "courseId": 1,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": null
        }
      },
      {
        "examId": null,
        "courseId": null,
        "teacherId": null,
        "examPlace": "德玛西亚",
        "examTime": 1430755200000,
        "examAppointTime": 1499356800000,
        "examForm": "网上考试",
        "examAddtime": null,
        "examMotifyPerson": null,
        "examMotifyDate": null,
        "examDelete": null,
        "course": {
          "courseId": 1,
          "examId": null,
          "teacherId": null,
          "scoreId": null,
          "dissentId": null,
          "majorId": null,
          "examPaperId": null,
          "courseName": "化学2",
          "courseScore": null,
          "courseEdition": null,
          "courseClass": null,
          "courseOnlineTestScorce": null,
          "courseFinalTestScorce": null,
          "courseOnlineScorce": null,
          "coursePlan": null,
          "courseCreateDate": null,
          "courseModifyPerson": null,
          "courseModifyDate": null,
          "courseDelete": null,
          "courseInfo": null,
          "teacher": null
        }
      }
    ]}
    
}) ;
		
		//添加
    mock.onPost('/api/teacher/score/insertSelective').reply(200,{status:200, message:'', resData: insertSelective}) ;
    // 查询多表信息
    mock.onPost('/api/teacher/score/getAllListScore').reply(200,{status:200, message:'', resData: getAllListScore}) ;
    //根据ID查询
    mock.onPost('/api/teacher/score/selectIdName').reply(200,{status:200, message:'', resData: selectIdName}) ;
    //修改
    mock.onPost('/api/teacher/score/updateByPrimaryKey').reply(200,{status:200, message:'', resData: updateByPrimaryKey});
		mock.onPost('/api/student/listCourse').reply(200, {
			status: 200,
			message: '',
			resData: _listCourse
		});
		mock.onPost('/api/teacher/section/list').reply(200, {
			status: 200,
			message: '',
			resData: [
			{
				"sectionId": 1,
    "scoreId": 1,
    "sectionTestId": 1,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "第1章 搭建java的开发环境",
    "sectionAddtime": 1498665600000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499702400000,
    "sectionDelete": 1,
    "partSections": [
      {
        "partId": 1,
        "videoId": null,
        "sectionId": null,
        "partIdName": "第一讲",
        "partName": "1.1 jdk的环境搭建",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 2,
        "videoId": null,
        "sectionId": null,
        "partIdName": "第二讲",
        "partName": "1.2 JVM是什么",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 7,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "1.3 跑谁人解",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 11,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "阿萨德法师打发",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 12,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "asdfasdfasdfasdfasdfasdfasd",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 13,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "阿萨德发色",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 14,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "12234545",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      }
    ]
  },
  {
    "sectionId": 2,
    "scoreId": 1,
    "sectionTestId": 2,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "第二章 Java语言基础",
    "sectionAddtime": 1498665600000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499788800000,
    "sectionDelete": 1,
    "partSections": [
      {
        "partId": 3,
        "videoId": null,
        "sectionId": null,
        "partIdName": "第一讲",
        "partName": "2.1 Java常用数据类型",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      }
    ]
  },
  {
    "sectionId": 3,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "java面对对象",
    "sectionAddtime": 1496937600000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1496937600000,
    "sectionDelete": 1,
    "partSections": [
      {
        "partId": 5,
        "videoId": null,
        "sectionId": null,
        "partIdName": "aaaaa",
        "partName": "cccccccccccccccccccccccccccccc",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      }
    ]
  },
  {
    "sectionId": 27,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "过户接口",
    "sectionAddtime": 1499616000000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499702400000,
    "sectionDelete": 1,
    "partSections": [
      {
        "partId": 8,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "阿萨德发生的发生的发斯蒂芬",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      }
    ]
  },
  {
    "sectionId": 29,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 2,
    "teacherId": 1,
    "sectionName": "123456",
    "sectionAddtime": 1499616000000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499788800000,
    "sectionDelete": 1,
    "partSections": [
      {
        "partId": 9,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "阿萨德发生的发生",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      },
      {
        "partId": 10,
        "videoId": null,
        "sectionId": null,
        "partIdName": "不必填写",
        "partName": "阿萨德发生的方法的太阳镜越靠近",
        "partFrequence": null,
        "partAddtime": null,
        "partModifyPerson": null,
        "partModifyDate": null,
        "partDelete": null
      }
    ]
  },
  {
    "sectionId": 28,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "阿萨德发色的父",
    "sectionAddtime": 1499616000000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1500393600000,
    "sectionDelete": 0,
    "partSections": []
  },
  {
    "sectionId": 30,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 2,
    "teacherId": 1,
    "sectionName": "5.2asopdifghpsfgasp[0eifgp-0asrhp0sae9",
    "sectionAddtime": 1499875200000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499875200000,
    "sectionDelete": 1,
    "partSections": []
  },
  {
    "sectionId": 31,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 2,
    "teacherId": 1,
    "sectionName": "抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱抱吧",
    "sectionAddtime": 1499875200000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499961600000,
    "sectionDelete": 1,
    "partSections": []
  },
  {
    "sectionId": 32,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 2,
    "teacherId": 1,
    "sectionName": "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊",
    "sectionAddtime": 1499875200000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1499961600000,
    "sectionDelete": 1,
    "partSections": []
  },
  {
    "sectionId": 33,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "eeeeeeeeeeeeee",
    "sectionAddtime": 1500393600000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1500393600000,
    "sectionDelete": 0,
    "partSections": []
  },
  {
    "sectionId": 34,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": 1,
    "teacherId": 1,
    "sectionName": "听听听听听听听听听听听听听听他天天",
    "sectionAddtime": 1500480000000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1500480000000,
    "sectionDelete": 0,
    "partSections": []
  },
  {
    "sectionId": 35,
    "scoreId": null,
    "sectionTestId": null,
    "courseId": null,
    "teacherId": null,
    "sectionName": "javaweb基础",
    "sectionAddtime": 1516204800000,
    "sectionModifyPerson": "zhangsan",
    "sectionModifyDate": 1516204800000,
    "sectionDelete": 1,
    "partSections": []
  }	
		]});

		mock.onPost('/api/teacher/courseware/list').reply(200, {
			status: 200,
			message: '',
			resData: {
				"pageNum": 1,
				"pageSize": 5,
				"size": 2,
				"startRow": 1,
				"endRow": 2,
				"total": 50,
				"pages": 1,
				"list": [{
						"coursewareId": 2,
						"resourceId": 4,
						"coursewareName": "java第一章第二节",
						"coursewareSize": 200,
						"coursewarePath": "/resource/2.txt",
						"coursewareAddtime": 1498752000000,
						"coursewareDelete": 0
					},
					{
						"coursewareId": 3,
						"resourceId": 5,
						"coursewareName": "java第二章第一节",
						"coursewareSize": 5000,
						"coursewarePath": "/resource/3.txt",
						"coursewareAddtime": 1435593600000,
						"coursewareDelete": 1
					},
					{
						"coursewareId": 4,
						"resourceId": 6,
						"coursewareName": "java第二章第一节",
						"coursewareSize": 300,
						"coursewarePath": "/resource/4.txt",
						"coursewareAddtime": 1498752000000,
						"coursewareDelete": 1
					},
					{
						"coursewareId": 5,
						"resourceId": 7,
						"coursewareName": "777",
						"coursewareSize": 100,
						"coursewarePath": "/resource/5.txt",
						"coursewareAddtime": 1495382400000,
						"coursewareDelete": 1
					},
					{
						"coursewareId": 6,
						"resourceId": 7,
						"coursewareName": "777",
						"coursewareSize": 100,
						"coursewarePath": "/resource/5.txt",
						"coursewareAddtime": 1506009600000,
						"coursewareDelete": 1
					}
				]

			}

		});
		mock.onPost('/api/teacher/notice/getNoticeById').reply(200, {
			status: 200,
			message: '',
			resData:

			{
				"noticeId": 3,
				"noticeName": "公告提示",
				"teacherId": 2,
				"noticeDate": 1499616000000,
				"noticeTarget": 2,
				"noticeCreateDate": 1499616000000,
				"noticeModifyDate": 1499616000000,
				"noticeModifyPerson": "张老师",
				"noticeDelete": 1,
				"noticeInf": "关于做好节假日安全通知"
			}
		});

		mock.onPost('/api/teacher/notice/list').reply(200, {
			status: 200,
			message: '',
			resData: {

				"pageNum": 1,
    "pageSize": 5,
    "size": 5,
    "startRow": 1,
    "endRow": 5,
    "total": 41,
    "pages": 9,

				"list": [{
						"noticeId": 3,
						"noticeName": "公告提示",
						"teacherId": 2,
						"noticeDate": 1499616000000,
						"noticeTarget": 2,
						"noticeCreateDate": 1499616000000,
						"noticeModifyDate": 1499616000000,
						"noticeModifyPerson": "张老师",
						"noticeDelete": 1,
						"noticeInf": "关于做好节假日安全通知"
					},
					{
						"noticeId": 4,
						"noticeName": "公告标题",
						"teacherId": 3,
						"noticeDate": 1499616000000,
						"noticeTarget": 2,
						"noticeCreateDate": 1499616000000,
						"noticeModifyDate": 1499616000000,
						"noticeModifyPerson": "张老师",
						"noticeDelete": 1,
						"noticeInf": "关于做好节假日放假通知"
					},
					{
						"noticeId": 5,
						"noticeName": "公告标题",
						"teacherId": 4,
						"noticeDate": 1499616000000,
						"noticeTarget": 2,
						"noticeCreateDate": 1499616000000,
						"noticeModifyDate": 1499616000000,
						"noticeModifyPerson": "张三",
						"noticeDelete": 1,
						"noticeInf": "关于做好节假日放假通知"
					},
					{
						"noticeId": 6,
						"noticeName": "公告标题",
						"teacherId": 5,
						"noticeDate": 1499616000000,
						"noticeTarget": 2,
						"noticeCreateDate": 1499616000000,
						"noticeModifyDate": 1499616000000,
						"noticeModifyPerson": "张三",
						"noticeDelete": 1,
						"noticeInf": "关于做好节假日放假通知"
					},
					{
						"noticeId": 7,
						"noticeName": "公告标题",
						"teacherId": 6,
						"noticeDate": 1499616000000,
						"noticeTarget": 2,
						"noticeCreateDate": 1499616000000,
						"noticeModifyDate": 1499616000000,
						"noticeModifyPerson": "张三",
						"noticeDelete": 1,
						"noticeInf": "关于做好节假日放假通知"
					}

				]
			}
		});

		//模拟学生登陆
		mock.onPost('/api/student/login').reply(config => {

			/*
			some() 方法用于检测数组中的元素是否满足指定条件（函数提供）。
			some() 方法会依次执行数组的每个元素：
			如果有一个元素满足条件，则表达式返回true , 剩余的元素不会再执行检测。
			如果没有满足条件的元素，则返回false。
			*/
			/*
			  JSON对象有两个方法：stringify()和parse()。在最简单的情况下，
			  这两个方法分别用于把JavaScript对象序列化为JSON字符串和把JSON字符串解析为原生JavaScript。
			*/

			let {
				user,
				password,
				rememberMe
			} = JSON.parse(config.data)
			return new Promise((resolve, reject) => { //异步操作，成功resolve继续执行
				let resultData = null;
				setTimeout(() => { // 短暂延迟后
					let hasUser = loginUsers.some(u => {
						if(u.user === user && u.password === password) {
							resultData = JSON.parse(JSON.stringify(u));
							resultData.password = '';
							resultData.rememberMe = rememberMe;
							return true;
						}
					})
					if(hasUser) { /* 异步操作成功 */
						console.log("resultData:" + resultData);
						resolve([200, {
							status: 200,
							message: '登陆成功',
							resultData
						}]);
					} else {
						reject(500, {
							status: 505,
							message: '账号或密码错误'
						});
					}
				}, 200)
			});

			// promise.then(function(value) {
			//  // success
			// }, function(value) {
			//  // failure
			// });
		})
	}
}